<?php
namespace app\admin\controller;
use think\Controller;
use think\Validate;
use think\Db;
use think\Session;
class Index extends Basic
{  

	
    public function index()
    {

     return $this->fetch();
    }
	public function top()
    {
     $admin=Db::name('admin')->where('id',Session::get('adminid'))->find();
	  $this->assign('admin',$admin); 
     return $this->fetch();
    }
	public function left()
    {
		
		$id=input('param.id');
		
		if(!$id){$id='user';}
        $arr=admindhl($id);
        //$arr=$arr[$id];

		$this->assign('arr',$arr); 
		
     return $this->fetch();
    }
	
	public function sounds(){
      $pay=Db::name('txlist')->where("yid",'1')->max('id');
      $id="0";
      if($pay){
      $id=$pay;
      }
     $date['order']= Db::name('txlist')->where("id>'".$id."' and  state='0'")->count();
      
       $payf=Db::name('paylist')->where("yid",'1')->max('id');
      $idf="0";
      if($payf){
      $idf=$payf;
      }
     $date['pay']= Db::name('paylist')->where("id>'".$idf."' and  state='0'")->count();
      $num=$date['pay']+$date['order'];
      if($num>0){
      $date['resdata']='1';
      }
      return json($date);
      
    
    }
	
	

	public function logout(){
	Session::set('adminid','');
	header('Location: index');
	die;
	}
}
